# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pygexf
pkgname=('python2-pygexf' 'python-pygexf')
_pkgname=pygexf
pkgver=0.2.2
pkgrel=6
pkgdesc='Python library to generate gexf file format.'
arch=('any')
url='https://pypi.org/project/pygexf/#files'
license=('LGPL')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('7e0e87abbea99a304a4dc89ec7ab64ffb8721dfe514ceddf613d4a05cb6dd69d9f6ac393d0fb40235b6669a95af0060d4c1a4d8cb37652a02b96347c899012fb')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pygexf() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

package_python-pygexf() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" -O1 --skip-build
}

